-- @owner: @zhanghuan96
-- @date: 2024/9/19
-- @testpoint: rownum作为变量名
@conn PrimaryDbDmode;
--step1:rownum作为变量名;expect:成功
drop function if exists func_rownum0022();
CREATE OR REPLACE FUNCTION func_rownum0022()
RETURNS BIGINT
LANGUAGE plpgsql
AS $$
DECLARE
    rownum BIGINT;
BEGIN
    rownum := @@spid;
    RAISE NOTICE 'NOTICE:当前会话进程ID: %', rownum;
    RETURN rownum;
END;
$$;
/
--step2:调用函数;expect:成功
call func_rownum0022();
--step3:清理环境;expect:成功
drop function if exists func_rownum0022();